feat: add npm sync validation to NodePackageManager and theme builders#93
Merged
feat: add npm sync validation to NodePackageManager and theme builders#93
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Fix: npm ci not executed when packages are out of sync
Problem
During the theme build process,
npm ciwas not being executed when new packages were added topackage-lock.jsonin Hyva and TailwindCSS themes. TheautoRepair()method only checked if thenode_modulesdirectory existed, not whether the installed packages matched the lock file specification.This could lead to build failures when:
package.json/package-lock.jsonnode_modulesexisted but contained outdated or missing packagesSolution
Implemented proper npm synchronization validation using
npm lsto detect package state:1. New
isNodeModulesInSync()MethodFile:
src/Service/NodePackageManager.phpnode_modulesis synchronized withpackage-lock.jsonnpm ls --depth=0 --jsonto validate all packages are installed with correct versionsfalsewhen packages are missing, outdated, or have version mismatchespackage-lock.jsondoesn't exist (returnstrue)2. Updated Theme Builders
Files: